Strict equality (===) 您所在的位置:网站首页 Strict equality === Strict equality (===)

Strict equality (===)

2024-05-29 04:00| 来源: 网络整理| 查看: 265

The strict equality operators (=== and !==) provide the IsStrictlyEqual semantic.

If the operands are of different types, return false. If both operands are objects, return true only if they refer to the same object. If both operands are null or both operands are undefined, return true. If either operand is NaN, return false. Otherwise, compare the two operand's values: Numbers must have the same numeric values. +0 and -0 are considered to be the same value. Strings must have the same characters in the same order. Booleans must be both true or both false.

The most notable difference between this operator and the equality (==) operator is that if the operands are of different types, the == operator attempts to convert them to the same type before comparing.



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有